{template 'common/header'}

<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('house', array('op'=>'display'));}">房源列表</a></li>
	<li><a href="{php echo $this->createWebUrl('house', array('op'=>'edit'));}">添加房源</a></li>
</ul>

<div class="main">
	<div class="panel panel-default">
		<div class="panel-heading">房列表</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th class="col-sm-2">小区名称</th>
							<th class="col-sm-1">房号</th>
							<th class="col-sm-2">房型</th>
							<th class="col-sm-2">装修</th>
							<th class="col-sm-2">月租金</th>
							<th class="col-sm-1">状态</th>
							<th class="col-sm-2 text-right">操作</th>
						</tr>
					</thead>
					<tbody>
						{loop $goodses $goodsid $goods}
						<tr>
							<td>{$goods['village_name']}</td>
							<td>{$goods['building_num']}栋{$goods['house_num']}室</td>
							<td>{$goods['rooms']}室{$goods['hall']}厅{$goods['toilet']}卫</td>
							<td>{$goods['decoration']}</td>
							<td>{$goods['rental']}元</td>
							<td>{php echo $this->getHouseStatus($goods['sale_status']);}</td>
							<td class="text-right">
								<a href="{php echo $this->createWebUrl('house', array('op'=>'edit', 'id'=>$goodsid));}" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
								<a onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;" href="{php echo $this->createWebUrl('house', array('op'=>'delete', 'id'=>$goodsid));}" class="btn btn-default btn-danger" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除"><i class="fa fa-times"></i> </a>
							</td>
						</tr>
						{/loop}
						{if empty($goodses)}
						<tr>
							<td colspan="8">
								尚未添加房源
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
	</div>
</div>

{template 'common/footer'}